<template>
  <div style="margin-top: 1.5%">
    <div>
      <!--ADR-->
      <div style="width: 100%">
        <div class="bname" ref="block0">ADR事件情况</div>
        <div style="color:red;margin-top: 1%;font-size: 14px">新的、严重的药品ADR应当在15日内报告，其中导致死亡的须立即报告；其他药品ADR应当在30日内报告。</div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="basicform1" :model="basicForm" rules="rules"  label-width="140px">
            <el-form-item label="报告类别" prop="undesirableReportCategory" >
              <el-radio-group v-model="basicForm.undesirableReportCategory" onclick="return false" >
                <el-radio label="01">首次报告</el-radio>
                <el-radio label="02">跟踪报告</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="报告类型" prop="undesirableReportType">
              <el-radio-group v-model="basicForm.undesirableReportType" onclick="return false" >
                <el-radio label="01">新的一般</el-radio>
                <el-radio label="02">新的严重</el-radio>
                <el-radio label="03">一般</el-radio>
                <el-radio label="04">严重</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="不良反应/事件名称" prop="undesirableBadName"  style="width: 600px">
              <el-input v-model="basicForm.undesirableBadName" placeholder="如:头晕(一般);呕吐(严重)" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="不良反应/事件发生时间" prop="undesirableTimeOccurrence" >
              <el-date-picker
                v-model="basicForm.undesirableTimeOccurrence"
                type="datetime"
                placeholder="选择日期时间"
                :readonly="true">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="不良反应/事件发现时间" prop="undesirableTimeFindings" >
              <el-date-picker
                v-model="basicForm.undesirableTimeFindings"
                type="datetime"
                placeholder="选择日期时间"
                :readonly="true">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="不良反应/事件过程描述" prop="undesirableDescriptionProcess"
                          style="width: 600px;">
              <el-input type="textarea" :readonly="true" v-model="basicForm.undesirableDescriptionProcess" :rows="11" resize="none"></el-input>
              <span style="color:red;margin-top: 1%;font-size: 14px">(包括症状、体征、临床检验等)及处理情况</span>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <!--患者信息-->
      <div style="width: 100%; margin-top:1%">
        <div class="bname" ref="block1" style="border-top: 1px solid rgba(165,169,175,0.29);padding-top:0.5%">患者信息</div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="reportform1" :model="reportForm"  label-width="140px">
            <el-form-item label="诊疗类别" prop="patientDiagnosisCategory" >
              <el-radio-group v-model="reportForm.patientDiagnosisCategory" onclick="return false" >
                <el-radio label="01">急诊</el-radio>
                <el-radio label="02">门诊</el-radio>
                <el-radio label="03">住院</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="患者姓名" prop="patientName" >
              <el-input :readonly="true" v-model="reportForm.patientName"></el-input>
            </el-form-item>
            <el-form-item label="性别" prop="patientGender" >
              <el-radio-group v-model="reportForm.patientGender" onclick="return false" >
                <el-radio label="01">男</el-radio>
                <el-radio label="02">女</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="出生日期" prop="patientDateOfBirth">
              <el-date-picker
                v-model="reportForm.patientDateOfBirth"
                type="date"
                placeholder="选择日期"
                :readonly="true">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="年龄">
              <el-input v-model="reportForm.patientAge" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="年龄阶段">
              <div>
                <dict-tag style="font-size: 15px;color:black" :options="dict.type.he_patient_age_grades" :value="reportForm.patientAgeStage"/>
              </div>
<!--              <el-select v-model="reportForm.patientAgeStage" placeholder="请选择" filterable>
                <el-option
                  :readonly="true"
                  v-for="item in dict.type.he_patient_age_grades"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  :disabled="true">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="民族">
              <div>
                <dict-tag style="font-size: 15px;color:black" :options="dict.type.he_patient_ethnic_group" :value="reportForm.patientEthnicGroup"/>
              </div>
<!--              <el-select v-model="reportForm.patientEthnicGroup" placeholder="请选择" filterable>
                <el-option
                  v-for="item in dict.type.he_patient_ethnic_group"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  :readonly="true">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="体重(公斤)" style="width: 600px;">
              <el-input v-model="reportForm.patientWeight" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="联系方式" style="width: 600px;" prop="patientContact" >
              <el-input v-model="reportForm.patientContact" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="原患疾病" style="width: 600px;" prop="patientPreDisease" >
              <el-input v-model="reportForm.patientPreDisease" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="病历号/门诊号" style="width: 600px;">
              <el-input v-model="reportForm.patientRecordOutpatient" :readonly="true"></el-input>
            </el-form-item>
          </el-form>

        </div>
      </div>

      <!--相关重要信息-->
      <div style="width: 100%; margin-top:1%">
        <div class="bname" ref="block2" style="border-top: 1px solid rgba(165,169,175,0.29);padding-top:0.5%">相关重要信息
        </div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="basicform2" :model="basicForm" label-width="140px">
            <el-form-item label="既往药品不良反应/事件">
              <el-radio-group v-model="basicForm.undesirablePreviousAdverse" onclick="return false" >
                <el-radio label="01">有</el-radio>
                <el-radio label="02">无</el-radio>
                <el-radio label="03">不详</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="家族药品不良反应/事件">
              <el-radio-group v-model="basicForm.undesirableFamilialAdverse" onclick="return false" >
                <el-radio label="01">有</el-radio>
                <el-radio label="02">无</el-radio>
                <el-radio label="03">不详</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="相关重要信息">
              <el-checkbox-group v-model="undesirableRelatedImportant" onclick="return false" >
                <el-checkbox label="01">吸烟史</el-checkbox>
                <el-checkbox label="02">饮酒史</el-checkbox>
                <el-checkbox label="03">妊娠期</el-checkbox>
                <el-checkbox label="04">肝病史</el-checkbox>
                <el-checkbox label="05">肾病史</el-checkbox>
                <el-checkbox label="06">过敏史</el-checkbox>
                <el-checkbox label="07">其他</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
<!--            <el-form-item label="其他" style="width: 600px">
              <el-input v-model="form.otherInform"></el-input>
            </el-form-item>-->
            <el-form-item label="过敏情况说明" style="width: 600px">
              <el-input v-model="basicForm.undesirableAllergyDescription" :readonly="true"></el-input>
            </el-form-item>
          </el-form>

        </div>
      </div>

      <!--药品信息-->
      <div style="width: 100%; margin-top:1%">
        <div class="bname" ref="block3" style="border-top: 1px solid rgba(165,169,175,0.29);padding-top:0.5%">药品信息</div>
        <div style="color:blue;margin-top: 1%;font-size: 14px">怀疑药品</div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="basicform3" :model="basicForm" label-width="140px">
            <el-form-item label="药品种类" prop="undesirableDrugType" >
              <el-radio-group v-model="basicForm.undesirableDrugType" onclick="return false" >
                <el-radio label="01">全身性抗菌药物</el-radio>
                <el-radio label="02">降血糖药物</el-radio>
                <el-radio label="03">抗肿瘤药物</el-radio>
                <el-radio label="04">抗凝剂</el-radio>
                <el-radio label="05">镇痛药和解热药</el-radio>
                <el-radio label="06">心血管系统用药</el-radio>
                <el-radio label="07">X线造影剂及其他诊断性制剂</el-radio>
                <el-radio label="08">其他药物</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="批准文号" prop="undesirableApprovalNumber" style="width: 600px">
              <el-input v-model="basicForm.undesirableApprovalNumber" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="商品名称" style="width: 600px">
              <el-input v-model="basicForm.undesirableCommodityName" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="通用名称" prop="undesirableGenericName"  style="width: 600px">
              <el-input v-model="basicForm.undesirableGenericName" :readonly="true"></el-input>
            </el-form-item>
            <el-form-item label="剂型" prop="undesirableDosageForm" >
              <div>
                <dict-tag style="font-size: 15px;color:black" :options="dict.type.he_undesirable_dosage_form" :value="basicForm.undesirableDosageForm"/>
              </div>

<!--              <el-select :readonly="true" v-model="basicForm.undesirableDosageForm" placeholder="请选择" filterable>
                <el-option
                  v-for="item in dict.type.he_undesirable_dosage_form"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="生产厂家" prop="undesirableManufacturer" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableManufacturer"></el-input>
            </el-form-item>
            <el-form-item label="生产批号" prop="undesirableProductionBatch"  style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableProductionBatch"></el-input>
            </el-form-item>
            <el-form-item label="用量" prop="undesirableDose"  style="width: 700px">
              <div style="display: flex">
                <el-input :readonly="true" v-model="basicForm.undesirableDose"></el-input>
                <span style="margin-left:10px; float:right; color: red; font-weight:bolder;width: 110px">每次用药剂量</span>
              </div>
            </el-form-item>
            <el-form-item label="单位" prop="undesirableUnit" >
              <div>
                <div>
                  <dict-tag style="font-size: 15px;color:black" :options="dict.type.he_undesirable_unit" :value="basicForm.undesirableUnit"/>
                </div>

<!--                <el-select v-model="basicForm.undesirableUnit" placeholder="请选择" filterable :readonly="true">
                  <el-option
                    v-for="item in dict.type.he_undesirable_unit"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>-->
                <div style="display: flex; width: 200px;align-items: center">
                  <el-input v-model="basicForm.undesirableDay" :readonly="true" style="margin-top: 10px;"></el-input>
                  <span
                    style="margin-left:10px; margin-top: 10px; float:right; color: #606266; font-weight:bolder;width: 20px">日</span>
                </div>
                <div style="display: flex; width: 265px;align-items: center">
                  <el-input v-model="basicForm.undesirableFrequency" :readonly="true" style="margin-top: 10px;"></el-input>
                  <span
                    style="margin-left:10px; margin-top: 10px; float:right; color: #606266; font-weight:bolder;width: 120px">次(给药次数)</span>
                </div>
              </div>
            </el-form-item>
            <el-form-item label="给药途径" prop="undesirableAdministrationRoute" >
              <div>
                <dict-tag style="font-size: 15px;color:black" :options="dict.type.he_administration_route" :value="basicForm.undesirableAdministrationRoute"/>
              </div>
<!--              <el-select v-model="basicForm.undesirableAdministrationRoute" :readonly="true" placeholder="请选择" filterable>
                <el-option
                  v-for="item in dict.type.he_administration_route"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="用药起时间" :readonly="true" prop="undesirableStartTime" >
              <el-date-picker
                :readonly="true"
                v-model="basicForm.undesirableStartTime"
                type="datetime"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="用药止时间" :readonly="true" prop="undesirableStopTime" >
              <el-date-picker
                :readonly="true"
                v-model="basicForm.undesirableStopTime"
                type="datetime"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="用药原因" :readonly="true" prop="undesirableMedicationUseReason" style="width: 600px">
              <el-input v-model="basicForm.undesirableMedicationUseReason"></el-input>
            </el-form-item>
          </el-form>

        </div>
<!--        <div style="color:blue;margin-top: 10px;font-size: 14px">并用药品</div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="form" :model="form" label-width="140px">
            <el-form-item label="药品种类" :rules="[{required: true, message: '药品种类未选择'}]">
              <el-radio-group v-model="form.bymedicineType">
                <el-radio label="全身性抗菌药物"></el-radio>
                <el-radio label="降血糖药物"></el-radio>
                <el-radio label="抗肿瘤药物"></el-radio>
                <el-radio label="抗凝剂"></el-radio>
                <el-radio label="镇痛药和解热药"></el-radio>
                <el-radio label="心血管系统用药"></el-radio>
                <el-radio label="X线造影剂及其他诊断性制剂"></el-radio>
                <el-radio label="其他药物"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="批准文号" :rules="[{required: true, message: '批准文号不能为空'}]" style="width: 600px">
              <el-input v-model="form.byapprovalNum"></el-input>
            </el-form-item>
            <el-form-item label="商品名称" style="width: 600px">
              <el-input v-model="form.byproductName"></el-input>
            </el-form-item>
            <el-form-item label="通用名称" :rules="[{required: true, message: '通用名称不能为空'}]" style="width: 600px">
              <el-input v-model="form.bycurrentName"></el-input>
            </el-form-item>
            <el-form-item label="剂型" :rules="[{required: true, message: '剂型不能为空'}]">
              <el-select v-model="form.bydosageform" placeholder="请选择" filterable>
                <el-option
                  v-for="item in bydosageFormOption"
                  :key="item.value"
                  :label="item.value"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="生产厂家" :rules="[{required: true, message: '生产厂家不能为空'}]" style="width: 600px">
              <el-input v-model="form.bymanuFacturer"></el-input>
            </el-form-item>
            <el-form-item label="生产批号" :rules="[{required: true, message: '生产批号不能为空'}]" style="width: 600px">
              <el-input v-model="form.bymanuNum"></el-input>
            </el-form-item>
            <el-form-item label="用量" :rules="[{required: true, message: '用量不能为空'}]" style="width: 700px">
              <div style="display: flex">
                <el-input v-model="form.bydosage"></el-input>
                <span style="margin-left:10px; float:right; color: red; font-weight:bolder;width: 110px">每次用药剂量</span>
              </div>
            </el-form-item>
            <el-form-item label="单位" :rules="[{required: true, message: '单位不能为空'}]">
              <div>
                <el-select v-model="form.byunti" placeholder="请选择" filterable>
                  <el-option
                    v-for="item in byuntiOption"
                    :key="item.value"
                    :label="item.value"
                    :value="item.value">
                  </el-option>
                </el-select>
                <div style="display: flex; width: 200px;align-items: center">
                  <el-input v-model="form.byuntiDay" style="margin-top: 10px;"></el-input>
                  <span
                    style="margin-left:10px; margin-top: 10px; float:right; color: #606266; font-weight:bolder;width: 20px">日</span>
                </div>
                <div style="display: flex; width: 265px;align-items: center">
                  <el-input v-model="form.bycGiveyao" style="margin-top: 10px;"></el-input>
                  <span
                    style="margin-left:10px; margin-top: 10px; float:right; color: #606266; font-weight:bolder;width: 120px">次(给药次数)</span>
                </div>
              </div>
            </el-form-item>
            <el-form-item label="给药途径" :rules="[{required: true, message: '给药途径不能为空'}]">
              <el-select v-model="form.bygiveWay" placeholder="请选择" filterable>
                <el-option
                  v-for="item in bygiveWayOption"
                  :key="item.value"
                  :label="item.value"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用药起时间" :rules="[{required: true, message: '用药起时间不能为空'}]">
              <el-date-picker
                v-model="form.bymedstaTime"
                type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="用药止时间" :rules="[{required: true, message: '用药止时间不能为空'}]">
              <el-date-picker
                v-model="form.bymedstopTime"
                type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="用药原因" :rules="[{required: true, message: '用药原因不能为空'}]" style="width: 600px">
              <el-input v-model="form.bymedUsereason"></el-input>
            </el-form-item>
          </el-form>
        </div>-->
      </div>

      <!--评价与分析-->
      <div style="width: 100%; margin-top:1%">
        <div class="bname" ref="block4" style="border-top: 1px solid rgba(165,169,175,0.29);padding-top:0.5%">评价与分析
        </div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="basicform" :model="basicForm" label-width="140px">
            <el-form-item label="不良反应/事件的结果" prop="undesirablePoorResults" >
              <el-radio-group onclick="return false" v-model="basicForm.undesirablePoorResults">
                <el-radio label="01">痊愈</el-radio>
                <el-radio label="02">好转</el-radio>
                <el-radio label="03">未好转</el-radio>
                <el-radio label="04">不详</el-radio>
                <el-radio label="05">有后遗症</el-radio>
                <el-radio label="06">死亡</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="停药或减量后，反应/事件是否消失或减轻？" prop="undesirablePoorResults" label-width="300px"></el-form-item>
            <el-form-item>
              <el-radio-group onclick="return false" v-model="basicForm.undesirableReactionDisappears">
                <el-radio label="01">是</el-radio>
                <el-radio label="02">否</el-radio>
                <el-radio label="03">不明</el-radio>
                <el-radio label="04">未停药或为减量</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item  label="再次使用可疑药品后是否出现同样反应/事件？" label-width="300px"></el-form-item>
            <el-form-item>
              <el-radio-group onclick="return false" v-model="basicForm.undesirableUseAgainReaction">
                <el-radio label="01">是</el-radio>
                <el-radio label="02">否</el-radio>
                <el-radio label="03">不明</el-radio>
                <el-radio label="04">未停药或为减量</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="对原患疾病的影响" prop="undesirableInfluenceDisease" >
              <el-radio-group onclick="return false" v-model="basicForm.undesirableInfluenceDisease">
                <el-radio label="01">不明显</el-radio>
                <el-radio label="02">病程延长</el-radio>
                <el-radio label="03">病情加重</el-radio>
                <el-radio label="04">导致后遗症</el-radio>
                <el-radio label="05">导致死亡</el-radio>
              </el-radio-group>
            </el-form-item>
            <div style="color:#28ef1a; margin-top: 1%; margin-bottom:10px; font-size: 14px">关联性评价</div>
            <el-form-item label="报告人评价" prop="undesirableReporterEvaluation" >
              <el-radio-group onclick="return false" v-model="basicForm.undesirableReporterEvaluation">
                <el-radio label="01">肯定</el-radio>
                <el-radio label="02">很可能</el-radio>
                <el-radio label="03">可能</el-radio>
                <el-radio label="04">可能无关</el-radio>
                <el-radio label="05">待评价</el-radio>
                <el-radio label="06">无法评价</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="签名" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableReporterSignature"></el-input>
            </el-form-item>
            <el-form-item label="报告人联系电话" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableReporterSignature"></el-input>
            </el-form-item>
            <el-form-item label="报告人职业" prop="undesirableReporterOccupation" >
              <el-radio-group onclick="return false" v-model="basicForm.undesirableReporterOccupation">
                <el-radio label="01">医生</el-radio>
                <el-radio label="02">药师</el-radio>
                <el-radio label="03">护士</el-radio>
                <el-radio label="04">其他</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="报告单位评价">
              <el-radio-group onclick="return false" v-model="basicForm.undesirableUnitEvaluation">
                <el-radio label="01">肯定</el-radio>
                <el-radio label="02">很可能</el-radio>
                <el-radio label="03">可能</el-radio>
                <el-radio label="04">可能无关</el-radio>
                <el-radio label="05">待评价</el-radio>
                <el-radio label="06">无法评价</el-radio>
              </el-radio-group>
              <div style="color: #8f8f94">注：药师填写</div>
            </el-form-item>
            <el-form-item label="签名" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableUnitSignature"></el-input>
            </el-form-item>
            <div style="color:#28ef1a; margin-top: 10px; margin-bottom:10px; font-size: 14px">报告单位信息</div>
            <el-form-item label="单位名称" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableOrganizationName"></el-input>
            </el-form-item>
            <el-form-item label="联系人" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableContactPerson"></el-input>
            </el-form-item>
            <el-form-item label="电话" style="width: 600px">
              <el-input :readonly="true" v-model="basicForm.undesirableContactPhone"></el-input>
            </el-form-item>
            <el-form-item label="备注" style="width: 600px" prop="undesirableNote">
              <el-input :readonly="true" type="textarea" v-model="basicForm.undesirableNote" :rows="3" resize="none"></el-input>
            </el-form-item>
          </el-form>
        </div>
      </div>

      <!--事件结果-->
      <div style="width: 100%; margin-top:1%">
        <div class="bname" ref="block5" style="border-top: 1px solid rgba(165,169,175,0.29);padding-top:0.5%">事件结果</div>
        <div class="block" style="margin-top: 0.5%;">
          <el-form ref="reportform" :model="reportForm" label-width="140px" >
            <el-form-item label="纠纷或纠纷隐患可能性" prop="resultsPossibilityDispute" >
              <el-radio-group onclick="return false" v-model="reportForm.resultsPossibilityDispute">
                <el-radio label="01">确定有</el-radio>
                <el-radio label="02">可能有</el-radio>
                <el-radio label="03">无</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="事件严重程度" prop="resultsEventSeverity" >
              <div>
                <dict-tag style="font-size: 15px;color: #dd524d" :options="dict.type.he_event_severity" :value="reportForm.resultsEventSeverity"/>
              </div>
<!--              <el-select :readonly="true" v-model="reportForm.resultsEventSeverity" placeholder="请选择" filterable>
                <el-option
                  v-for="item in dict.type.he_event_severity"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="事件分级" style="width: 600px" prop="resultsEventClassification" >
              <el-radio-group onclick="return false" v-model="reportForm.resultsEventClassification">
                <el-radio label="01" style="margin-top: 10px; margin-bottom: 10px">Ⅰ级事件: 发生错误，造成患者死亡 (包括损害程度I级)</el-radio>
                <el-radio label="02" style="margin-bottom: 10px">Ⅱ级事件: 发生错误，且造成患者伤害 (包括损害程度E、F、G、H级)</el-radio>
                <el-radio label="03" style="margin-bottom: 10px">Ⅲ级事件: 发生错误，但未造成患者伤害 (包括损害程度B、C、D级)</el-radio>
                <el-radio label="04">Ⅳ级事件: 错误未发生 (错误隐患)(包括损害程度A级)</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="伤害严重度" prop="resultsSeverityInjury" >
              <el-radio-group onclick="return false" v-model="reportForm.resultsSeverityInjury">
                <el-radio label="01">死亡</el-radio>
                <el-radio label="02">极度严重</el-radio>
                <el-radio label="03">重度</el-radio>
                <el-radio label="04">中度</el-radio>
                <el-radio label="05">轻度</el-radio>
                <el-radio label="06">未造成伤害</el-radio>
                <el-radio label="07">无伤害</el-radio>
              </el-radio-group>
            </el-form-item>
<!--            <el-form-item label="再次使用可疑药品后是否出现同样反应/事件？" label-width="300px"></el-form-item>
            <el-form-item>
              <el-radio-group v-model="form.againInfact">
                <el-radio label="是"></el-radio>
                <el-radio label="否"></el-radio>
                <el-radio label="不明"></el-radio>
                <el-radio label="未停药或为减量"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="对原患疾病的影响" :rules="[{required: true, message: '对原患疾病的影响未选择'}]">
              <el-radio-group v-model="form.yuanYing">
                <el-radio label="不明显"></el-radio>
                <el-radio label="病程延长"></el-radio>
                <el-radio label="病情加重"></el-radio>
                <el-radio label="导致后遗症"></el-radio>
                <el-radio label="导致死亡"></el-radio>
              </el-radio-group>
            </el-form-item>-->
          </el-form>
        </div>

      </div>

    </div>

    <!--保存按钮-->
    <div style="position: fixed; margin-top: -0.5%; right: 3%; width: 300px">
      <el-button
        type="primary"
        style="margin-left: 15px"
        @click="submitForm"
      >保存
      </el-button>
      <el-button
        type="info" plain
        style="margin-left: 15px"
        @click=""
      >返回
      </el-button>
    </div>

  </div>
</template>


<script>
import ScrollPane from "@/layout/components/TagsView/ScrollPane";
import {addReport, updateReport} from "@/api/module/whd/report";
import {getBasic} from "@/api/module/shao/shijian/basic";

export default {
  dicts: ['he_undesirable_report_type','he_administration_route', 'he_undesirable_dosage_form', 'he_undesirable_unit', 'he_patient_status', 'undesirable_drug_type', 'he_piping_type', 'he_report_event_type', 'he_medication_error_type','he_education', 'he_patient_gender', 'he_party_post', 'he_report_event_state', 'he_report_event_type', 'he_patient_age_grades', 'he_event_severity', 'he_review_status', 'he_report_status', 'he_position', 'he_event_classification', 'he_review_event_type', 'he_possibility_of_dispute', 'he_patient_involved', 'he_patient_ethnic_group', 'he_fallback_status', 'he_occurrence_time_period', 'he_event_determinatione', 'he_situation_measures_event', 'he_patient_education_level', 'he_diagnosis_category', 'he_years_of_experience', 'he_severity_of_injury', 'he_reporting_method', 'he_patient_nursing_level', 'he_date_type', 'he_invalidation_status', 'he_patient_ethnic_group', 'he_category', 'he_handling_status'],

  components: {ScrollPane},
  data() {
    return {
      undesirableRelatedImportant:[],
      isDisabled: true,
      basicForm:{
        undesirableReportCategory: null,
        undesirableReportType: null,
        undesirableDamage: null,
        undesirableBadName: null,
        undesirableTimeOccurrence: null,
        undesirableTimeFindings: null,
        undesirableDescriptionProcess: '患者XXX，因“XXX”原患疾病于XXX时间入院（就诊），临床诊断XXX，从X年X月X日X时（用药起始时间）开始使用XXX药物（溶媒用量+药品用量、用法，按该顺序填写，如未使用溶媒，就不用填写溶媒）。\n' +
          '于XXX（第一次发生ADR的时间）时间，在用XXX药（如果多种药物同时使用，必须提供一个药物使用的顺序）XXX分钟/小时后，发生XXX反应，立即采取（干预时间）XXX措施（干预措施，如停止用药，并予以溶媒用量+药品用量、用法，按该顺序填写，如未使用溶媒，就不用填写溶媒），给予XXX（包含剂量）药物治疗，XXX分钟/小时（ADR终结时间）后症状缓解（ADR终结结果）。',
        undesirablePreviousAdverse: null,
        undesirableFamilialAdverse: null,
        undesirableRelatedImportant: null,
        undesirableAllergyDescription: null,
        undesirableDrugType: null,
        undesirableApprovalNumber: null,
        undesirableCommodityName: null,
        undesirableGenericName: null,
        undesirableDosageForm: null,
        undesirableManufacturer: null,
        undesirableProductionBatch: null,
        undesirableDose: null,
        undesirableUnit: null,
        undesirableDay: null,
        undesirableFrequency: null,
        undesirableAdministrationRoute: null,
        undesirableStartTime: null,
        undesirableStopTime: null,
        undesirableMedicationUseReason:null,
        undesirablePoorResults: null,
        undesirableReactionDisappears: null,
        undesirableUseAgainReaction: null,
        undesirableInfluenceDisease: null,
        undesirableReporterEvaluation: null,
        undesirableReporterSignature: null,
        undesirableReporterPhone: null,
        undesirableReporterOccupation: null,
        undesirableUnitEvaluation: null,
        undesirableUnitSignature: null,
        undesirableOrganizationName: null,
        undesirableContactPerson: null,
        undesirableContactPhone: null,
        undesirableNote: null,


      },
      reportForm:{
        reportEventType:"22",
        //患者部分
        patientInvolved: null,
        patientId: null,
        patientNumber: null,
        patientDiagnosisCategory: null,
        patientRecordOutpatient: null,
        patientName: null,
        patientGender: null,
        patientDateOfBirth: null,
        patientAge: null,
        patientAgeStage: null,
        patientEthnicGroup: null,
        patientWeight: null,
        patientPreDisease: null,
        patientContact: null,
        patientFamilyNumber: null,
        patientAdmissionTime: null,
        patientDepartment: null,
        patientBedNumber: null,
        patientNursingLevel: null,
        patientEducationLevel: null,
        patientDiagnosis: null,
        //事件结果
        resultsPossibilityDispute: null,
        resultsEventSeverity: null,
        resultsEventClassification: null,
        resultsSeverityInjury: null,
        reviewEventType:"01",
        note1:"药物不良事件"

      },
      form: {
        heEventBasic: {},
        heEventReport: {},
        heEventFlow:{}
      },
      rules:{
        patientDiagnosisCategory:[{
          required:true,message:"科室编号不能为空",trigger:"blur"
        }],


      },
      fileList: []
    }
  },
  // 禁止web端屏幕缩放
  created() {
    const id = this.$route.query.id;
    if(id){
      this.isDisabled=true;
    }
    getBasic(id).then(response => {
      //获取后台传过来的表单
      this.formEvent = response.data;
      //将其对应赋值进行表单渲染
      this.basicForm=this.formEvent.heEventBasic
      this.reportForm=this.formEvent.heEventReport
      //用于多选框反显
      /*this.checkList=this.pushCheckbox(this.basicForm.bedTreatmentConditions)
      this.yuanyin=this.pushCheckbox(this.basicForm.bedReasonsFalling)
      this.chuli=this.pushCheckbox(this.basicForm.bedFallDisposal)*/
      this.undesirableRelatedImportant=this.pushCheckbox(this.basicForm.undesirableRelatedImportant)
    });
   /* window.addEventListener("mousewheel", function (event) {
      if (event.ctrlKey === true || event.metaKey) {
        event.preventDefault();
      }
    }, {passive: false})*/
  },
  methods: {
    pushCheckbox(str){
      const boxlist=str.split(",");
      return boxlist;
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["basicform1"].validate(valid=>{
        if(valid){
          this.$refs["reportform1"].validate(valid=>{
            if(valid){
              this.$refs["basicform2"].validate(valid=>{
                if(valid){
                  this.$refs["basicform3"].validate(valid=>{
                    if(valid){
                      this.$refs["basicform"].validate(valid=>{
                        if(valid){
                          console.log(valid)
                          this.$refs["reportform"].validate(valid=>{
                            if(valid){
                              this.form.heEventReport=this.reportForm
                              this.form.heEventBasic=this.basicForm
                              if (this.form.id != null) {
                                updateReport(this.form).then(response => {
                                  this.$modal.msgSuccess("修改成功");
                                  this.open = false;
                                  this.getList();
                                });
                              } else {
                                addReport(this.form).then(response => {
                                  this.$modal.msgSuccess("新增成功");
                                  this.open = false;
                                  this.getList();
                                });
                              }

                            }
                          })
                        }
                      });

                    }

                  });
                }

              });
            }

          });
        }

      });


      /*console.log(this.form)
      this.$refs["form"].validate(valid => {
        if (valid) {

        }
      });*/
    },
    //el 标签  speed 滚动速率 此处是50px 值越大滚动的越快
    goAssignBlock(el, speed) {
      let t = this.$refs[el].offsetTop - 100

      function scrollToTop() {
        let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

        if (scrollTop > t) {
          window.scrollTo(0, scrollTop - speed);

          // 使用 requestAnimationFrame 进行平滑滚动
          requestId = window.requestAnimationFrame(scrollToTop);
        } else {
          window.scrollTo(0, t);

          // 取消动画帧的请求
          window.cancelAnimationFrame(requestId);
        }
      }

      let requestId = window.requestAnimationFrame(scrollToTop);
    },

  },

}

</script>

<style lang="scss" scoped>
@import "src/views/module/shao/blackFont";
.sidebar {
  margin-left: 3%;
  width: 10%;
  float: left;
  display: flex;
}
.btn-box {
  position: fixed;
  margin-top: 1%;

  ::v-deep .el-card__body {
    padding: 15px 15px 15px 5px;
  }
}

.btn-box button {
  text-align: left;
  padding: 0 0 0 10px;
  display: block;
  width: 150px;
  height: 40px;
  border: none;
  cursor: pointer;
}

.btn-box button:hover {
  background: hsl(221, 98%, 68%);
  color: white;
}

.block {
  border: 1px solid white;
  width: 100%;
  height: 100%;
  display: flex;
  font-size: 5rem;
  box-sizing: border-box;

  .el-form-item {
    margin-bottom: 10px;
  }
}

.bname {
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
  font-weight: bold;
  font-size: 20px;
  color: #000000;
}

</style>
